package com.xpsoft.oa.dao.produce.impl;


import java.util.List;

import org.hibernate.Query;

import com.xpsoft.core.dao.impl.BaseDaoImpl;
import com.xpsoft.oa.dao.produce.MaterialDumpingInfoDao;
import com.xpsoft.oa.model.produce.MaterialDumpingInfo;

public class MaterialDumpingInfoDaoImpl extends BaseDaoImpl<MaterialDumpingInfo> implements MaterialDumpingInfoDao{

	public MaterialDumpingInfoDaoImpl() {
		super(MaterialDumpingInfo.class);
	}

	@Override
	public void deleteMaterialDumpingInfos(Long dumpId, List<Long> idList) {
		// TODO Auto-generated method stub
		String hql = "delete from MaterialDumpingInfo where id not in (:ids) and materialDumping.id=:dumpId";
		Query query =  getSession().createQuery(hql);
		query.setParameterList("ids", idList).setParameter("dumpId", dumpId);
		query.executeUpdate();
	}

}